package com.heima.utils.thread;

import com.heima.model.admin.pojos.AdUser;
import com.heima.model.user.pojos.ApUser;

/**
 * 自媒体微服务的线程工具类
 */
public class AdUserThreadLocalUtil {

    private final  static  ThreadLocal<AdUser> AD_USER_THREAD_LOCAL
            = new ThreadLocal<>();
    /**
     * 添加数据
     */
    public static  void setUser(AdUser adUser){
        AD_USER_THREAD_LOCAL.set(adUser);
    }
    /**
     * 获取数据
     */
    public static AdUser getUser(){
        return AD_USER_THREAD_LOCAL.get();
    }
    /**
     * 清理数据
     */
    public static  void clear(){
        AD_USER_THREAD_LOCAL.remove();
    }

}
